﻿using QLTour.Ultilities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace QLTour.Dal
{
    public class ThamQuanDal
    {
        DatabaseHelper db = new DatabaseHelper();

        public bool Insert(Biz.ThamQuanBiz tq)
        {
            int rs = db.ExecuteNonQuery("INSERT INTO [ThamQuan](MaDiaDiem, ThuTu, MaTour) VALUES(" + tq.MaDiaDiem + ", " + tq.ThuTu + ",'" + tq.MaTour + "')");
            return rs > 0;
        }

        public int XoaHetDiaDiem(Biz.TourBiz tour)
        {
            string query = "DELETE FROM [ThamQuan] WHERE [MaTour]='" + tour.MaTour + "'";
            return db.ExecuteNonQuery(query);
        }
    }
}
